package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.domain.User;
import com.itheima.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    public List<User> findAll() {
        return userDao.findAll();
    }

    public void save(User user) {
            userDao.save(user);
    }

    public void delete(Integer sid) {
        userDao.delete(sid);
    }

    public void update(User user) {
            userDao.update(user);
    }

    public User findById(Integer sid) {
        return userDao.findById(sid);
    }
}
